<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    424. Longest Repeating Character Replacement
   </h1>
   <p>
    Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most
    <i>
     k
    </i>
    times. Find the length of a longest substring containing all repeating letters you can get after performing the above operations.
   </p>
   <p>
    <b>
     Note:
    </b>
    <br>
    Both the string's length and
    <i>
     k
    </i>
    will not exceed 10
    <sup>
     4
    </sup>
    .
   </p>
   <p>
    <b>
     Example 1:
    </b>
   </p>
   <pre>
<b>Input:</b>
s = "ABAB", k = 2

<b>Output:</b>
4

<b>Explanation:</b>
Replace the two 'A's with two 'B's or vice versa.
</pre>
   <p>
    <b>
     Example 2:
    </b>
   </p>
   <pre>
<b>Input:</b>
s = "AABABBA", k = 1

<b>Output:</b>
4

<b>Explanation:</b>
Replace the one 'A' in the middle with 'B' and form "AABBBBA".
The substring "BBBB" has the longest repeating letters, which is 4.
</pre>
  </div>
  <div>
   <h1 class="question_title">
    424. 替换后的最长重复字符
   </h1>
   <p>
    给你一个仅由大写英文字母组成的字符串，你可以将任意位置上的字符替换成另外的字符，总共可最多替换&nbsp;
    <em>
     k&nbsp;
    </em>
    次。在执行上述操作后，找到包含重复字母的最长子串的长度。
   </p>
   <p>
    <strong>
     注意:
    </strong>
    <br>
    字符串长度 和
    <em>
     k
    </em>
    不会超过&nbsp;10
    <sup>
     4
    </sup>
    。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong>
s = "ABAB", k = 2

<strong>输出:</strong>
4

<strong>解释:</strong>
用两个'A'替换为两个'B',反之亦然。
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre><strong>输入:</strong>
s = "AABABBA", k = 1

<strong>输出:</strong>
4

<strong>解释:</strong>
将中间的一个'A'替换为'B',字符串变为 "AABBBBA"。
子串 "BBBB" 有最长重复字母, 答案为 4。
</pre>
  </div>
 </body>
</html>